package com.mrd.netty.thrift;



import com.mrd.netty.six.MyDataInfo;
import com.mrd.thrift.generated.DataException;
import com.mrd.thrift.generated.Person;
import com.mrd.thrift.generated.PersonService;
import org.apache.thrift.TException;

/**
 * @author jack
 * @data 2019/5/9 15:11
 */
public class PersonServiceImpl implements PersonService.Iface{

    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("got client parm" + username);

        Person person = new Person();
        person.setAge(11);
        person.setUsername("jack");
        person.setMarried(false);
        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {
        System.out.println("save client parm： " + person.getUsername());

        System.out.println(person.toString());

    }
}
